'\"macro stdmacro
.\"
.\" Copyright (c) 2022 Ken McDonell.  All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PMASORTINDOM 3 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmaSortInDom\f1 \- sort an instance domain
.SH "C SYNOPSIS"
.ft 3
.ad l
.hy 0
#include <pcp/pmapi.h>
.br
#include <pcp/libpcp.h>
.br
#include <pcp/archive.h>
.sp
void pmaSortInDom(__pmLogInDom *\fIlidp\fP);
.sp
cc ... \-lpcp_archive \-lpcp
.hy
.ad
.ft 1
.SH CAVEAT
This documentation is intended for internal Performance Co-Pilot
(PCP) developer use.
.PP
These interfaces are not part of the PCP APIs that are guaranteed to
remain fixed across releases, and they may not work, or may provide
different semantics at some point in the future.
.SH DESCRIPTION
.de CR
.ie t \f(CR\\$1\fR\\$2
.el \fI\\$1\fR\\$2
..
The instance domain identified by
.I lidp
is sorted in ascending internal instance identifier value.
Both the
.IR lidp -> instlist []
array and the corresponding
.IR lidp -> namelist []
array are sorted.
.PP
Since instance domains are usually sorted (at their source by a PMDA),
a bubble sort is used.
This means that if the caller is unsure if the instance domain is
sorted (but it actually is already sorted), then calling
.B pmaSortInDom
is as fast as checking if the instance domain is sorted, so
when in doubt, simply call
.BR pmaSortInDom .
.SH DIAGNOSTICS AND RETURN VALUES
None.
.SH SEE ALSO
.BR PMAPI (3)
and
.BR pmGetInDom (3).
